home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Misc / GMS / GMSDev / Source / C / Raster / Colourlist.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-12-16  |  1.2 KB  |  56 lines

  1. /* Displays a colour list (24 bit colour lines).  To exit the demo, press the
  2. ** left mouse button.
  3. */
  4.  
  5. #include <proto/dpkernel.h>
  6.  
  7. BYTE *ProgName      = "Colour List Demo";
  8. BYTE *ProgAuthor    = "Paul Manias";
  9. BYTE *ProgDate      = "16 December 1997";
  10. BYTE *ProgCopyright = "DreamWorld Productions (c) 1996-1997.  Freely distributable.";
  11. BYTE *ProgShort     = "Colour list demonstration.";
  12.  
  13. LONG Colourlist[257];
  14.  
  15. struct RColourList RColourList = {
  16.   ID_RASTCOLOURLIST, 1, NULL, NULL, NULL,
  17.   000,1,0,Colourlist
  18. };
  19.  
  20. void main(void)
  21. {
  22.    struct GScreen *Screen;
  23.    struct JoyData *joydata;
  24.    struct Raster  *Raster;
  25.    WORD i;
  26.  
  27.    if (Raster = Get(ID_RASTER)) {
  28.  
  29.       Raster->Command = (struct RHead *)&RColourList;
  30.  
  31.       for (i=0; i<257; i++) {   /* Generate our colourlist */
  32.         Colourlist[i] = i<<16;
  33.       } Colourlist[i] = -1;
  34.  
  35.       if (joydata = Init(Get(ID_JOYDATA),NULL)) {
  36.          if (Screen = InitTags(NULL,
  37.               TAGS_SCREEN, NULL,
  38.               GSA_Raster,  Raster,
  39.               TAGEND)) {
  40.  
  41.             Display(Screen);
  42.  
  43.             while (!(joydata->Buttons & JD_LMB)) {
  44.                Query(joydata);
  45.                WaitAVBL();
  46.             }
  47.  
  48.          Free(Screen);
  49.          }
  50.       Free(joydata);
  51.       }
  52.    Free(Raster);
  53.    }
  54. }
  55.  
  56.